In a database system, the earliest point in time at which any currently active transaction first accessed a database object for read or write access may be desired to be tracked for a variety of reasons. For example, the earliest first write access time for any currently active transaction for an object, such as a table, table space, or object therein, may be used to determine whether certain data is committed or is not yet committed. Similarly, the time at which the earliest first read access by any currently active transaction on an object was made may be used to determine if deleted data on the database system is no longer needed. If the data is not needed, the data may be removed such as to be unrestorable. Consequently, using the earliest read and write access times for all currently active transaction accessing an object is valuable in managing locking and performing space management.
In order to track the earliest access times for the set of all currently active transactions, conventional tracking methods may utilize a log sequence number. The log sequence number is the current position of the database system's log write cursor. A commit LSN (CLSN) is a particular LSN that corresponds to a particular point in time that is at least as old as the earliest access time to a database object or system for the set of all currently active transactions. A particular CLSN value corresponds to a particular time and, therefore, may be considered to be representative of that time. The CLSN values were initially used for tracking write transactions. However, conventional methods of tracking the initial access times currently use the LSN values to determine the first point in time that any currently active transaction accessed a database object for read and/or write access.
Conventional database systems track the CLSN values in a number of ways. Certain conventional systems maintain the CLSN values at a system level. For example, a single CLSN value may be tracked for all objects within a database system. Although tracking the CLSN values at a system level is possible, one of ordinary skill in the art will readily recognize that CLSN values maintained in such a conventional manner are prone to becoming stale. For example, a single transaction that runs for days may result in a stale CLSN value that is quite old in comparison to remaining transactions accessing a different database object. Consequently, processes that use this stale CLSN value may be less effective in performing their functions. In space management, for example, data that will not be used by existing transactions may be less likely to be removed. Consequently, if a conventional method that tracks CLSN values at the system level is used, a single long-running transaction may adversely affect performance of the entire database system. Moreover, a particular transaction accessing a particular database object may also affect other transactions, including those which do not access the same database object. This result of including system-level tracking is also undesirable.
Another conventional method may maintain CLSN values for each database object. In such conventional systems a conventional linked list may be associated with each object. The conventional linked list includes information about all currently active read and write transactions accessing the database object. Consequently, the CLSN values for each object in the database system may be accurately maintained.
Although conventional methods that maintain CLSN values using linked lists for each object may not suffer from stale CLSN values, other drawbacks persist. In particular, these linked list-based methods for maintaining the conventional CLSN values for each object on the database system may consume substantial resources. Because such conventional methods may have high overhead, such conventional methods may have a significant adverse impact on performance of the conventional databases system.
Accordingly, what is needed is a more efficient method and system for tracking the earliest first access time for the set of all currently active transactions in a database system accessing an individual object. The present invention addresses such a need.